#建立列表
list1 = []
list2 = []

#自定义异常类
class paramsTypeError(Exception):
    pass

#用for循环
def for1(x, b=0):
    list1.append(b)
    conter = 0
    try:
        list1.append(int(x))
    except:
        raise paramsTypeError("这个数据不能转换，请输入其他类型参数")
    finally:
        pass
    for i in range(10):
        conter +=1
        list1.append(list1[conter-1]+list1[conter])
    return list1

#用while循环
def while1(n, c=0):
    list2.append(c)
    ccd = 0
    try:
        list2.append(int(n))
    except:
        raise paramsTypeError("这个数据不能转换，请输入其他类型参数")
    finally:
        pass
    while True:
        ccd +=1
        list2.append(list2[ccd-1]+list2[ccd])
        if ccd < 11:
            pass
        else:
            break
    return list2

#测试
print(for1('1'))
print(while1('1'))
